<div>
	<form method="post" id="form_${action_id}" name="form_${action_id}" enctype="multipart/form-data" >
	<input type="hidden" id="entity.id" name="entity.id" value="${entity.id?default('')}">
    <table class="form-table" cellpadding=3>
    	<tr>
            <td>${action.getDatagridTitle('name')}:</td>
            <td><input id="entity.name" name="entity.name" value="${entity.name?default('')}" type="text" style="width: 300px;"  class="easyui-validatebox" data-options="required:true,validType:'length[1,64]'"   /></td>
        </tr>
        <tr>
            <td>${action.getDatagridTitle('order')}:</td>
            <td><input id="entity.order" name="entity.order" value="${entity.order?default('')}" type="text" style="width: 300px;"  class="easyui-numberspinner" data-options="editable:false,required:true,min:1,max:999"   /></td>
        </tr>
        <tr>
        	<td>${action.getDatagridTitle('state')}:</td>
            <td><select id="entity.state" name="entity.state" class="easyui-combobox" style="width:300px;">
            	<#list states as st>
            		<option value="${st.state}" <#if st.state==entity.state>selected</#if>>${action.getDatagridTitle('state.'+st.name())}</option>
            	</#list>
            </td>
        </tr>
        <tr>
        	<td>${action.getDatagridTitle('type')}:</td>
            <td><select id="entity.type" name="entity.type.id" class="easyui-combobox" style="width:300px;">
            	<#list types as type>
            		<option value="${type.id}" <#if type.id==entity.type.id>selected</#if>>${type.name}</option>
            	</#list>
            </td>
        </tr>
        <tr>	
			<td>${action.getDatagridTitle('icon')}：</td>
			<input type="hidden" name="entity.icon" value="${entity.icon?default('')}" id="entity_icon_value_${action_id}" />
			<input type="file" id="entity_icon_${action_id}" name="icon" onchange="$('#entity_icon_${action_id}_filename').empty();$('#entity_icon_${action_id}_filename').text(this.value);" style="display: none" />
			<td colspan="3">
				<a href="javascript:;;" onclick="$('#entity_icon_${action_id}').click();" class="easyui-linkbutton" data-options="iconCls:'icon-save'">选择文件</a>
				<a href="javascript:;;" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-tip'" id="entity_icon_preview_${action_id}" >预览</a>
				<span id="entity_icon_${action_id}_filename">
					<!--<img style="width:64px;height:64px;" src="${downloadUrl?default('')}${entity.icon?default('')}?_v=${timeMillis}" />-->
				</span>
        		<script type="text/javascript">
       			$(function(){
       				$('#entity_icon_preview_${action_id}').preview({html:'<div style="border:#c0c0c0 1px solid;background-color: white;"><img src="${downloadUrl}${entity.icon?default('')}" /></div>'});
       			})
        		</script>
			</td>
		</tr>
    </table>
	</form>
</div>
